<?php
/**
 * build mail class 
 *    $to_list=$to_list=array(0=>array('to_name'=>$payerName,'to_email'=>$payerEmail));
 */

class buildEmail{
	
	  private $emailXMl;
	  function buildEmail($to_list=array(),$email_subject='',$email_content='',$from_name='',
	  		$from_email='',$reply_to_name='',$reply_to_email='',  $sending_account_id='')
	  {
          $emailFormatObject=new emailFormat($to_list,$sending_account_id,$from_name,$from_email,
          	$reply_to_name,$reply_to_email,$email_subject,$email_content);
	  	  $this->emailXml=$emailFormatObject->buildEmail();
	  }
	  
	  function saveEmail($emailFileNamePrefix,$saveEmailDir)
	  {
	  	  $currentDate=date('YmdHis');
	  	  $emailFileName=$emailFileNamePrefix.$currentDate.".xml";
	      file_put_contents($saveEmailDir.$emailFileName,$this->emailXml); 
	  }
	
	
}


?>